<template>
  <div class="dashboard-container-header">
    <img
      src="@/assets/images/head_line@1x.png"
      alt="head_line"
      class="dashboard-container-header-line"
    />
    <div class="dashboard-container-header-left" @click="goBack">
      <span>
        <i class="el-icon-d-arrow-left" v-if="sidebar.opened"></i>
        <i class="el-icon-d-arrow-right" v-else></i>
        <span class="dashboard-container-header-left-text" v-text="sidebar.opened?'收缩':'扩展'"/>
      </span>
    </div>
    <div class="dashboard-container-header-title">
      <span>“虎鲸·智数”智能数据安全集中化管理工具</span>
    </div>
    <div class="dashboard-container-header-right" @click="fullScreen">
      <span>
        <span class="dashboard-container-header-right-text">全屏</span>
        <i class="el-icon-full-screen"></i>
      </span>
    </div>
  </div>
</template>

<script>
  import {mapGetters} from 'vuex';
  import screenfull from 'screenfull';

  export default {
  name: "Header",
  computed: {
    ...mapGetters([
      'sidebar'
    ])
  },
  // mounted() {
  //   this.goBack();
  // },
  methods: {
    goBack() {
      this.$store.dispatch('app/toggleSideBar')
    },
    fullScreen() {
      screenfull.toggle();
    }
  },
};
</script>

<style lang="scss" scoped>
.dashboard-container-header {
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  position: relative;

  &-line {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: auto;
  }

  .dashboard-container-header-left {
    display: flex;
    color: #129bff;
    cursor: pointer;

    &-logo {
      width: 16px;
      height: 16px;
    }

    &-text {
      font-size: 16px;
      margin-left: 5px;
    }
  }

  .dashboard-container-header-title {
    font-family: MiSans;
    font-weight: bold;
    font-size: 32px;
    line-height: normal;
    letter-spacing: 0px;
    text-align: left;
    background: linear-gradient(180deg, #ffffff 0%, #97ecfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .dashboard-container-header-right {
    /*display: flex;*/
    /*align-items: center;*/

    /*&-item {*/
    /*  font-size: 16px;*/
    /*  color: #fff;*/
    /*}*/

    display: flex;
    color: #129bff;
    cursor: pointer;

    &-logo {
      width: 16px;
      height: 16px;
    }

    &-text {
      font-size: 16px;
      margin-right: 5px;
    }
  }
}
</style>
